package com.code9xs.mapper;

import com.code9xs.pojo.Role;
import com.code9xs.pojo.UserRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface UserRoleMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(UserRole record);

    int insertSelective(UserRole record);

    UserRole selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(UserRole record);

    int updateByPrimaryKey(UserRole record);

    /**
     * 通过用户主键查询用户拥有的权限
     * uid 用户主键
     */
    List<Role> selectUserRoleByUID(@Param("uid") Integer uid);

    Integer insertUserRole(@Param("uid")Integer uid,@Param("rid")Integer rid);

    int deleteUserAllRole(@Param("uid")Integer uid);


}